package turring;

public class Transition {
	Etat next;
	char nouvelleLettre, ancienneLettre;
	int direction;

	Transition(char oldLetter, char newLetter, Etat state, int direction) {
		next = state;
		nouvelleLettre = newLetter;
		ancienneLettre = oldLetter;
		this.direction = direction;
	}

	public boolean transitionPossible(char lettreCible) {
		return lettreCible == ancienneLettre;
	}

	public Etat affectMachine(MachineTurring b) {

		b.setBande(b.Tete, nouvelleLettre);
		b.Tete += direction;
		return next;
	}
}
